// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   SmsItem.java

package net.sms;

import com.oa.database.DataConn;
import java.sql.*;
import java.util.*;
import java.util.Date;

// Referenced classes of package net.sms:
//            SmsItemInfo

public class SmsItem
{

    protected String sTable;
    protected String field_str[];
    protected String sCond;
    protected String sKeyField;
    protected DataConn dataConn;
    protected Connection conn;
    protected Statement stmt;
    protected ResultSet rs;
    protected int i;
    protected String sSQL;
    protected boolean flag;
    protected int intKey;
    protected ArrayList arrayList;
    protected HashMap hashMap;
    protected String strMessage;
    private Object object;
    private SmsItemInfo smsItemInfo;

    public SmsItem(DataConn dataConnection)
    {
        sTable = "";
        field_str = null;
        sCond = "";
        sKeyField = "";
        conn = null;
        stmt = null;
        rs = null;
        i = 0;
        sSQL = "";
        flag = false;
        intKey = 0;
        arrayList = new ArrayList();
        hashMap = new HashMap();
        strMessage = "";
        object = null;
        smsItemInfo = null;
        dataConn = dataConnection;
        conn = dataConn.getConnection();
    }

    public Collection getList(String sCondition)
    {
        stmt = null;
        try
        {
            sSQL = "select a.DXID,JSRSJ,DXBT from oajipin_DX_FS_ITEM A,oajipin_DX_FS B WHERE A.DXID = B.DXID AND " + sCondition;
            stmt = conn.createStatement();
            rs = stmt.executeQuery(sSQL);
            arrayList = new ArrayList();
            for(; rs.next(); arrayList.add(smsItemInfo))
            {
                smsItemInfo = new SmsItemInfo();
                smsItemInfo.setDXID(rs.getInt(1));
                smsItemInfo.setJSRSJ(rs.getString(2));
                smsItemInfo.setDXBT(rs.getString(3));
            }

            rs.close();
            stmt.close();
        }
        catch(Exception exception) { }
        return arrayList;
    }

    public void updateFlag(int iDXID, int iFlag)
    {
        stmt = null;
        try
        {
            Date strDate = new Date();
            stmt = conn.createStatement();
            sSQL = "update oajipin_DX_FS_ITEM set FSBZ= " + iFlag + ",XTCLSJ=" + strDate + " where DXID=" + iDXID;
            stmt.execute(sSQL);
            stmt.close();
        }
        catch(SQLException sqlexception) { }
    }
}
